export const namespace = "marketingPoster";
import { Image, Space } from "antd";

export const calcColumns = (params) => {
  // const { venueArr } = params;
  // let enumlist = {};
  // venueArr.forEach((v) => {
  //   enumlist[v.id] = {
  //     text: v.venueName,
  //   };
  // });
  const columns = [
    {
      title: "ID",
      hidden: process.env.UMI_ENV == "prod" ? true : false,
      width: 180,
      dataIndex: "id",
      hideInSearch: true,
    },
    {
      title: "海报名称",
      dataIndex: "name",
      hideInSearch: true,
    },
    {
      title: "内容",
      dataIndex: "imgUrl",
      render: (_, records) => {
        let { imgUrl } = records;
        return (
          <Space>
            <Image src={imgUrl} height={80} />
          </Space>
        );
      },
    },
    // {
    //   title: "所属场馆",
    //   dataIndex: "venueId",
    //   hideInSearch: true,
    //   valueEnum: enumlist,
    // },
    // {
    //   title: '更新人',
    //   dataIndex: 'updateBy',
    //   hideInSearch: true

    // },
    // {
    //   title: '更新时间',
    //   dataIndex: 'updateTime',
    //   hideInSearch: true
    // },

    {
      title: "状态",
      dataIndex: "status",
      // render: (state) => {
      //   return state ? <Tag border={false}>已启动</Tag> : <Tag color='#f0f'>禁用</Tag>
      // },
      valueEnum: {
        "0": { text: "已下架", status: "Default" },
        "1": { text: "已上架", status: "Success" },
      },
    },
  ];
  if (params?.operate) {
    columns.push(params?.operate);
  }
  return columns;
};
